package com.ocom.payconfig.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ocom.common.entity.company.EntityCompanyInfo;
import com.ocom.common.enums.DataSourceEnum;
import com.ocom.mysql.aspect.DataSourceAspect;
import com.ocom.payconfig.dao.IDaoCompanyInfo;
import com.ocom.payconfig.service.CompanyInfoService;
import org.springframework.stereotype.Service;


@Service
public class CompanyInfoServiceImpl extends ServiceImpl<IDaoCompanyInfo, EntityCompanyInfo> implements CompanyInfoService {


    /**获取单位信息*/
    @DataSourceAspect(type= DataSourceEnum.PART_DB,companyId = "comId")
    @Override
    public EntityCompanyInfo GetCompanyInfo(Long comId) {
        QueryWrapper<EntityCompanyInfo> wrapper = new QueryWrapper<>();
        wrapper.eq("com_id",comId);
        return this.getOne(wrapper);
    }





}
